<template>
  <div class="education-content">
          <div class="educationBox">
                <div class="headerBox">
                      <div class="line"></div>
                      <div class="title">教育培训</div>
                </div>

                 <div class="tabBox">
                         <div :class="{tabActive:tabIndex === index}" v-for="(item,index) in tabList" :key="index + 't'" @click="handleTab(index)">
                              <div class="tabList">{{item.name}}<div class="line" :class="{lineActive:tabIndex === index}"></div></div>   
                         </div>
                 </div>
                 <div v-if="tabIndex == 0">
                         <educationTouch />
                 </div>
                 <div v-if="tabIndex == 1">
                          <educationPerson />
                 </div>
                <div class="bottomBtnCss">
                  <el-button @click="goBackBtn">返回</el-button>
                 </div>
          </div>
  </div>
</template>

<script>
// import { getEducationTouch,getEducationPerson} from "@/api/zhangping/occupational";
import educationTouch from './components/educationTouch.vue' 
import educationPerson from './components/educationPerson.vue' 
export default {
     components:{
                educationTouch,
                educationPerson
              },
    data() {
      return {
         tabList:[{name:'接触职业病危害因素人员'},{name:'主要负责人和职业卫生管理人员'}],
         tabIndex:0,
      };
    },
    
    created() {

    },
    methods: {
         handleTab(index){
             this.tabIndex = index
         },
        goBackBtn(){
          this.$router.back()
        },
    }
  };
</script>
<style lang="scss" scoped>
         .display-fx-center{
             display: flex;
             align-items: center;
         }
         .per100{
             width: 100%!important;
         }
         .soildTop{
             border-top:solid 1px  #D3D8E2;
         }
         .education-content{
              overflow-y: auto;
              position: relative;
              background-color: #fff;
              padding: 40px 20px;
              border-radius: 10px;
              height: calc( 100vh - 66px - 40px);
             .educationBox{
                    padding-bottom:40px;

              }
           .headerBox{
                font-size: 16px;
                color: #484848;
                font-weight: bold;
                // margin-top:40px;/
                margin-bottom:15px;
                @extend .display-fx-center;
                .line{
                  width: 4px;
                  height: 12px;
                  background: #5D85FF;
                  border-radius: 6px 6px 6px 6px;
                  margin-right:6px;
                }
             }
          }
          .tabBox{
            margin-bottom:20px;
               @extend .display-fx-center; 
               .tabList{
                    font-size: 14px;
                    color: #797C84;
                    padding: 0 2px;
                    margin-right:30px;
                    cursor: pointer;  
                 }
                 .line{
                    width: 100%;
                    border-bottom: solid 3px #FFFFFF; 
                    border-radius:2px;  
                    margin-top:6px;
                 }
                 .lineActive{
                    border-bottom: solid 3px #5D85FF!important;     
                 }
          }
          .bottomBtnCss{
            text-align: right;
            position: fixed;
            bottom: 40px;
            right: 40px; 
        }   
</style>
